﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ObTookit
{
    /// <summary>
    /// 字段属性实体类
    /// </summary>
    public class FieldObject
    {
        private bool primaryKey;
        /// <summary>
        /// 是否主键
        /// </summary>
        public bool PrimaryKey
        {
            get { return primaryKey; }
            set { primaryKey = value; }
        }
        private bool foreignKey;
        /// <summary>
        /// 是否外键
        /// </summary>
        public bool ForeignKey
        {
            get { return foreignKey; }
            set { foreignKey = value; }
        }
        private bool identity;
        /// <summary>
        /// 是否标识字段（自增）
        /// </summary>
        public bool Identity
        {
            get { return identity; }
            set { identity = value; }
        }
        private int sort;
        /// <summary>
        /// 排序（在表字段中位置）
        /// </summary>
        public int Sort
        {
            get { return sort; }
            set { sort = value; }
        }
        private string name;
        /// <summary>
        /// 字段名称
        /// </summary>
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        private string alias;
        /// <summary>
        /// 字段别名
        /// </summary>
        public string Alias
        {
            get { return alias; }
            set { alias = value; }
        }

        private string dbType;
        /// <summary>
        /// 数据库字段类型
        /// </summary>
        public string DbType
        {
            get { return dbType; }
            set { dbType = value; }
        }

        private string type;
        /// <summary>
        /// 自定义字段类型
        /// </summary>
        public string Type
        {
            get { return type; }
            set { type = value; }
        }
        private int bytes;
        /// <summary>
        /// 字段占用字节大小
        /// </summary>
        public int Bytes
        {
            get { return bytes; }
            set { bytes = value; }
        }
        private int length;
        /// <summary>
        /// 字段长度
        /// </summary>
        public int Length
        {
            get { return length; }
            set { length = value; }
        }
        private int digits;
        /// <summary>
        /// 小数位数
        /// </summary>
        public int Digits
        {
            get { return digits; }
            set { digits = value; }
        }
        private bool nullable;
        /// <summary>
        /// 是否可为NULL
        /// </summary>
        public bool Nullable
        {
            get { return nullable; }
            set { nullable = value; }
        }
        private string defaultValue;
        /// <summary>
        /// 字段默认值
        /// </summary>
        public string DefaultValue
        {
            get { return defaultValue; }
            set { defaultValue = value; }
        }
        private string descr;
        /// <summary>
        /// 字段说明描述
        /// </summary>
        public string Descr
        {
            get { return descr; }
            set { descr = value; }
        }

        private string privateProp;
        /// <summary>
        /// 私有属性名称
        /// </summary>
        public string PrivateProp
        {
            get { return privateProp; }
            set { privateProp = value; }
        }
        private string publicProp;
        /// <summary>
        /// 公有属性名称
        /// </summary>
        public string PublicProp
        {
            get { return publicProp; }
            set { publicProp = value; }
        }

        private bool isList;
        /// <summary>
        /// 是否列表属性
        /// IntListField,LongListField,StringListField
        /// </summary>
        public bool IsList
        {
            get { return isList; }
            set { isList = value; }
        }
    }
}
